Add tool to generate services.kt file that contains mmv1 and tpgtools/DCL services#8344
Conversation
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR hasn't generated any diffs, but I'll let you know if a future commit does. |
|
👆 not sure if there are no diffs due to an error in my work, or protection in the CI against arbitrary code being executed |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR hasn't generated any diffs, but I'll let you know if a future commit does. |
I tested it locally and don't see errors. The DCL service packages are generated in the downstream providers. |
zli82016
left a comment
There was a problem hiding this comment.
LGTM. Thanks so much for the quick fix.
Tests analyticsTotal tests: Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccComputeFirewallPolicyRule_multipleRules|TestAccSpannerDatabaseIamPolicy|TestAccContainerAwsNodePool_BetaBasicHandWritten |
|
Rerun these tests in REPLAYING mode to catch issues
|
|
@zli82016 I'm a bit nervous about merging this - is it definitely not going to impact the alpha/ Edit: 😅 I realised that the |
Yeah, I think it does not affect impact alpha provider. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 9 insertions(+), 1 deletion(-)) |
Tests analyticsTotal tests: Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccComputeFirewallPolicyRule_multipleRules |
|
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR hasn't generated any diffs, but I'll let you know if a future commit does. |
Tests analyticsTotal tests: Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccComputeFirewallPolicyRule_multipleRules |
|
|
…/DCL services (#8344) * Add tool to generate services.kt file that contains mmv1 and tpgtools/DCL services * Fix log function call * Correct indentation size in service map output * Call teamcity Make target when generating TPG/TPGB * Add commas to generated map string * test change * update test * remove test file --------- Co-authored-by: Shuya Ma <shuyama@google.com>
…/DCL services (GoogleCloudPlatform#8344) * Add tool to generate services.kt file that contains mmv1 and tpgtools/DCL services * Fix log function call * Correct indentation size in service map output * Call teamcity Make target when generating TPG/TPGB * Add commas to generated map string * test change * update test * remove test file --------- Co-authored-by: Shuya Ma <shuyama@google.com>
…/DCL services (GoogleCloudPlatform#8344) * Add tool to generate services.kt file that contains mmv1 and tpgtools/DCL services * Fix log function call * Correct indentation size in service map output * Call teamcity Make target when generating TPG/TPGB * Add commas to generated map string * test change * update test * remove test file --------- Co-authored-by: Shuya Ma <shuyama@google.com>
…/DCL services (GoogleCloudPlatform#8344) * Add tool to generate services.kt file that contains mmv1 and tpgtools/DCL services * Fix log function call * Correct indentation size in service map output * Call teamcity Make target when generating TPG/TPGB * Add commas to generated map string * test change * update test * remove test file --------- Co-authored-by: Shuya Ma <shuyama@google.com>
…/DCL services (GoogleCloudPlatform#8344) * Add tool to generate services.kt file that contains mmv1 and tpgtools/DCL services * Fix log function call * Correct indentation size in service map output * Call teamcity Make target when generating TPG/TPGB * Add commas to generated map string * test change * update test * remove test file --------- Co-authored-by: Shuya Ma <shuyama@google.com>
Problem
Currently this PR #8254 generates the .teamcity folder in the downstream TPG and TPGB repos, and the generated code creates projects and build configurations in TeamCity without issue. One of the files needed for this is a map of the service packages, found in
.teamcity/components/generated/services.ktHowever, when this map of services is generated it contains only services generated by MMv1 and lacks services generated by tpgtools/DCL. This be because MMv1 generates files before tpgtools (see ordering here), so when the files in the .teamcity/ folder are generated the DCL services aren't created yet. The generator code iterates through folders in ./google/services/ and finds an incomplete list.
Proposed solution
The solutions for this could be:
unless version == 'ga'logic controlling inclusion of beta-only servicesservices.ktfile to tpgtools/DCL as it runs last in the generation process, so it will contain all servicesservices-dcl.ktfile, and update the Kotlin code to merge the two maps together when it creates build configs for each service.services.ktfile after both MMv1 and tpgtools/DCL are finishedI've chosen to do the last option of a separate tool, because this can be deleted away from the repo once all the DCL services are migrated to MMv1, all without any changes to the existing Kotlin code.
If this PR is for Terraform, I acknowledge that I have:
make testandmake lintin the generated providers to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)